/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.agreement.entity.serviceinvoice;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 服务发票Entity
 * @author shengbin
 * @version 2021-03-04
 */
@Table(name="t_service_invoice_detail", alias="a", columns={
		@Column(name="service_invoice_detail_id", attrName="serviceInvoiceDetailId", label="服务发票明细ID", isPK=true),
		@Column(name="invoice_item", attrName="invoiceItem", label="开票项目"),
		@Column(name="frame_number", attrName="frameNumber", label="车架号"),
		@Column(name="tax_amount", attrName="taxAmount", label="含税金额"),
		@Column(name="tax_rate", attrName="taxRate", label="税率"),
		@Column(name="tax", attrName="tax", label="税额"),
		@Column(name="untax_amount", attrName="untaxAmount", label="不含税金额"),
		@Column(name="invoice_number", attrName="invoiceNumber", label="税控发票号"),
		@Column(name="invoice_date", attrName="invoiceDate", label="发票日期"),
		@Column(name="service_invoice_id", attrName="serviceInvoiceId.serviceInvoiceId", label="服务发票ID"),
	}, orderBy="a.service_invoice_detail_id ASC"
)
public class TserviceInvoiceDetail extends DataEntity<TserviceInvoiceDetail> {
	
	private static final long serialVersionUID = 1L;
	private String serviceInvoiceDetailId;		// 服务发票明细ID
	private String invoiceItem;		// 开票项目
	private String frameNumber;		// 车架号
	private Double taxAmount;		// 含税金额
	private String taxRate;		// 税率
	private Double tax;		// 税额
	private Double untaxAmount;		// 不含税金额
	private String invoiceNumber;		// 税控发票号
	private String invoiceDate;		// 发票日期
	private TserviceInvoice serviceInvoiceId;		// 服务发票ID 父类
	
	public TserviceInvoiceDetail() {
		this(null);
	}


	public TserviceInvoiceDetail(TserviceInvoice serviceInvoiceId){
		this.serviceInvoiceId = serviceInvoiceId;
	}
	
	public String getServiceInvoiceDetailId() {
		return serviceInvoiceDetailId;
	}

	public void setServiceInvoiceDetailId(String serviceInvoiceDetailId) {
		this.serviceInvoiceDetailId = serviceInvoiceDetailId;
	}
	
	@Length(min=0, max=2, message="开票项目长度不能超过 2 个字符")
	public String getInvoiceItem() {
		return invoiceItem;
	}

	public void setInvoiceItem(String invoiceItem) {
		this.invoiceItem = invoiceItem;
	}
	
	@Length(min=0, max=100, message="车架号长度不能超过 100 个字符")
	public String getFrameNumber() {
		return frameNumber;
	}

	public void setFrameNumber(String frameNumber) {
		this.frameNumber = frameNumber;
	}
	
	public Double getTaxAmount() {
		return taxAmount;
	}

	public void setTaxAmount(Double taxAmount) {
		this.taxAmount = taxAmount;
	}
	
	@Length(min=0, max=10, message="税率长度不能超过 10 个字符")
	public String getTaxRate() {
		return taxRate;
	}

	public void setTaxRate(String taxRate) {
		this.taxRate = taxRate;
	}
	
	public Double getTax() {
		return tax;
	}

	public void setTax(Double tax) {
		this.tax = tax;
	}
	
	public Double getUntaxAmount() {
		return untaxAmount;
	}

	public void setUntaxAmount(Double untaxAmount) {
		this.untaxAmount = untaxAmount;
	}
	
	@Length(min=0, max=100, message="税控发票号长度不能超过 100 个字符")
	public String getInvoiceNumber() {
		return invoiceNumber;
	}

	public void setInvoiceNumber(String invoiceNumber) {
		this.invoiceNumber = invoiceNumber;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public String getInvoiceDate() {
		return invoiceDate;
	}

	public void setInvoiceDate(String invoiceDate) {
		this.invoiceDate = invoiceDate;
	}

	public String getInvoiceDate_gte() {
		return sqlMap.getWhere().getValue("invoice_date", QueryType.GTE);
	}

	public void setInvoiceDate_gte(String invoiceDate) {
		sqlMap.getWhere().and("invoice_date", QueryType.GTE, invoiceDate);
	}

	public String getInvoiceDate_lte() {
		return sqlMap.getWhere().getValue("invoice_date", QueryType.LTE);
	}

	public void setInvoiceDate_lte(String invoiceDate) {
		sqlMap.getWhere().and("invoice_date", QueryType.LTE, invoiceDate);
	}

	public TserviceInvoice getServiceInvoiceId() {
		return serviceInvoiceId;
	}

	public void setServiceInvoiceId(TserviceInvoice serviceInvoiceId) {
		this.serviceInvoiceId = serviceInvoiceId;
	}
	
}